<template>
    <div>
        <div v-for="(o, i) in usermsg" :key="i" class="personal-box personal">
            <div class="top">
                <router-link to="/user/login"><img v-if="!isLogin" src="@/assets/images/头像.png" alt=""></router-link>
                <!-- <div v-if="flag"> -->
                    <img v-if="isLogin" :src="require('../../../../server/public/images/user/avata/' + o.avata)" alt="">
                <!-- </div> -->
                <div class="idbox">
                    <router-link to="/user/login"><p v-if="!isLogin">{{ o.name }}</p></router-link>
                    <p v-if="isLogin">{{ o.name }}</p>
                    <span>账号: {{ o.user }}<svg t="1674987056061" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2285"><path stroke="#ffffff" stroke-width="25" d="M362.666667 896c-4.266667 0-8.533333 0-12.8-4.266667-8.533333-8.533333-8.533333-21.333333-4.266667-29.866666L631.466667 512 345.6 162.133333c-8.533333-8.533333-4.266667-21.333333 4.266667-29.866666 8.533333-8.533333 21.333333-4.266667 29.866666 4.266666l298.666667 362.666667c8.533333 8.533333 8.533333 21.333333 0 25.6l-298.666667 362.666667c-4.266667 4.266667-12.8 8.533333-17.066666 8.533333z" fill="#ffffff" p-id="2286"></path></svg></span>
                </div>
                <button>会员中心</button>
            </div>
            <div class="pdata">
                <ul>
                    <li>
                        <p>关注</p>
                        <span>{{ o.attention }}</span>
                    </li>
                    <li>
                        <p>粉丝</p>
                        <span>{{ o.fans }}</span>
                        
                    </li>
                    <li>
                        <p>发布</p>
                        <span>{{ o.issue }}</span>
                    </li>
                    <li>
                        <p>收藏</p>
                        <span>{{ o.favorite }}</span>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script>

import { mapState } from 'vuex';

export default {
    name: 'WorkspaceJsonMinePersonal',

    data() {
        return {
            usermsg: [],
            // flag: false,
        };
    },

    props: ['isLogin','userid'],
    
    computed: {
        ...mapState(['userinfo'])
    },
    methods: {
    },

    mounted() {
        
        if(this.userinfo.length != 0){this.usermsg = this.userinfo}else{
            this.usermsg = [{name: '请登录', user: '000000', avata: '', attention: 0, fans: 0, issue: 0, favorite: 0}]
        }
    },

    methods: {
        
    },
};
</script>

<style lang="sass" scoped>

</style>